import { axios } from '@/utils/request'

// api接口列表
const api = {
  list: '/user/list',
  detail: '/user/detail',
  recharge: '/user/recharge',
  grade: '/user/grade',
  delete: '/user/delete',
  setworker: '/user/rule',
  addcustomer: '/user/add',
  editcustomer: '/user/edit'

}
// 编辑用户
export function editcustomer (data) {
  return axios({
    url: api.editcustomer,
    method: 'post',
    data
  })
}
// 添加用户
export function addcustomer (data) {
  return axios({
    url: api.addcustomer,
    method: 'post',
    data
  })
}
// 列表记录
export function list (params) {
  return axios({
    url: api.list,
    method: 'get',
    params
  })
}

// 详情记录
export function detail (params) {
  return axios({
    url: api.detail,
    method: 'get',
    params
  })
}

/**
 * 会员充值
 * @param {*} data
 */
export function recharge (data) {
  return axios({
    url: api.recharge,
    method: 'post',
    data
  })
}

/**
 * 修改会员等级
 * @param {*} data
 */
export function grade (data) {
  return axios({
    url: api.grade,
    method: 'post',
    data
  })
}

/**
 * 删除记录
 * @param {*} data
 */
export function deleted (data) {
  return axios({
    url: api.delete,
    method: 'post',
    data: data
  })
}

/**
 * 修改身份
 * @param {*} data
 */
export function setworker (data) {
  return axios({
    url: api.setworker,
    method: 'post',
    data: data
  })
}
